package org.example.rabbitmqspring.listener;

import org.example.rabbitmqspring.constant.Constants;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

@Component
public class FanoutListener {
    @RabbitListener(queues = Constants.FANOUT_QUEUE1)
    public void workQueueListener1(String message) {
        System.out.println("广播模式消费的消息: " + message);
    }

    @RabbitListener(queues = Constants.FANOUT_QUEUE2)
    public void workQueueListener2(String message) {
        System.out.println("广播模式消费的消息: " + message);
    }


}
